from typing import Dict
from typing import List
from enum import IntEnum


class Market(IntEnum):
  NOMARKET = 0
  SZSE = 1
  SSE = 2
  SHFE = 3
  DCE = 4
  CZCE = 5
  CFFEX = 6
  INE = 7
  GFEX = 8

class RTTickData:
  datetime: int
  market: Market
  code: str
  prev_close: float
  num_trades: int
  volume: float
  total_turnover: float
  trading_phase_code: str
  last: float
  open: float
  high: float
  low: float
  close: float
  open_interest: float
  prev_settlement: float
  limit_up: float
  limit_down: float
  ask: List[float]
  bid: List[float]
  ask_vol: List[float]
  bid_vol: List[float]
  settlement: float
  def __init__(self) -> None:
   self.datetime = 0
   self.code = ""
   self.prev_close = 0.0
   self.num_trades = 0
   self.volume = 0.0
   self.total_turnover = 0.0
   self.trading_phase_code = ""
   self.last = 0.0
   self.open = 0.0
   self.high = 0.0
   self.low = 0.0
   self.close = 0.0
   self.open_interest = 0.0
   self.prev_settlement = 0.0
   self.limit_up = 0.0
   self.limit_down = 0.0
   self.ask = []
   self.bid = []
   self.ask_vol = []
   self.bid_vol = []
   self.settlement = 0.0


class RTTickDatas:
  datas: List[RTTickData]
  def __init__(self) -> None:
   self.datas = []


class SubscribeRTDataRequest:
  market: Market
  code: List[str]
  def __init__(self) -> None:
   self.code = []


class RTDataRequest:
  market: Market
  code: str
  date: int
  def __init__(self) -> None:
   self.code = ""
   self.date = 0


